<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" th:href="@{/adminLTE/bower_components/bootstrap/dist/css/bootstrap.min.css}">
    <!-- Font Awesome -->
    <link rel="stylesheet" th:href="@{/adminLTE/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/adminLTE/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/adminLTE/dist/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. We have chosen the skin-blue for this starter
          page. However, you can choose any other skin. Make sure you
          apply the skin class to the body tag so the changes take effect. -->
    <link rel="stylesheet" th:href="@{/adminLTE/dist/css/skins/skin-blue.min.css}">

    <link rel="stylesheet" th:href="@{/bootstrap-table/bootstrap-table.css}">

    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <title> - 修改密码</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
    <style type="text/css">
        .layui-form-item{
            margin: 50px 0 0 200px
        }
    </style>
</head>

<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">

    <header class="main-header" th:fragment="user_header">

        <!-- Logo -->
        <a href="#" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>11</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b></b>标准地名地址管理系统</b></span>
        </a>

        <!-- Header Navbar -->
        <nav class="navbar navbar-static-top" role="navigation">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">Toggle navigation</span>
            </a>
            <!-- Navbar Right Menu -->
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <!-- User Account Menu -->
                    <li class="dropdown user user-menu">
                        <!-- Menu Toggle Button -->
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <!-- The user image in the navbar-->
                            <img th:src="@{/adminLTE/img/头像.jpg}" class="user-image" alt="User Image">
                            <!-- hidden-xs hides the username on small devices so only the image appears. -->
                            <span class="hidden-xs" th:text="${session.current_user.userName}"></span>
                        </a>
                        <ul class="dropdown-menu">
                            <!-- The user image in the menu -->
                            <li class="user-header">
                                <img th:src="@{/adminLTE/img/头像.jpg}" class="img-circle" alt="User Image">

                                <p>

                                    <small> <span class="hidden-xs" th:text="${session.current_user.userName}"></span></small>
                                </p>
                            </li>
                            <!-- Menu Footer-->
                            <li class="user-footer">
                                <div class="pull-left">
                                    <a th:href="@{/user/toedit}" class="btn btn-default btn-flat">编辑资料</a>
                                </div>
                                <div class="pull-right">
                                    <a th:href="@{/user/tregister}" class="btn btn-default btn-flat">退出登录</a>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <!-- Control Sidebar Toggle Button -->
                    <li>
                        <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>

    <!-- Left side column. contains the logo and sidebar -->
    <aside class="main-sidebar" th:fragment="user_menu">

        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">

            <!-- search form (Optional) -->
            <form action="#" method="get" class="sidebar-form">

            </form>
            <!-- /.search form -->

            <!-- Sidebar Menu -->
            <ul class="sidebar-menu" data-widget="tree">
                <li class="header">主菜单</li>
                <!-- Optionally, you can add icons to the links -->

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-fw fa-bookmark"></i> <span>门牌申请管理</span>
                        <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="#"><i class="fa fa-circle-o"></i> 门牌申请</a></li>
                        <li><a href="#"><i class="fa fa-circle-o"></i> 门牌补发</a></li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-fw fa-circle-o-notch"></i> <span>管理通知</span>
                        <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/News/nlist"><i class="fa fa-circle-o"></i>新闻讯息</a></li>
                        <li><a href="#"><i class="fa fa-circle-o"></i>管理政策</a></li>
                        <li><a href="/Announce/list"><i class="fa fa-circle-o"></i>通知公告</a></li>
                    </ul>
                </li>

                <li class="treeview">
                    <a href="#"><i class="fa fa-fw fa-gear"></i> <span>系统设置</span>
                        <span class="pull-right-container">
                <i class="fa fa-angle-left pull-right"></i>
              </span>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/user/toedit"><i class="fa fa-fw fa-user"></i>修改个人资料</a></li>
                        <li><a href="/user/update"><i class="fa fa-fw fa-user"></i></i>修改密码</a></li>

                    </ul>
                </li>


            </ul>

            <!-- /.sidebar-menu -->
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" >
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                Page Header
                <small>Optional description</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
                <li class="active">Here</li>
            </ol>
        </section>

<fieldset id="dataList" class="layui-elem-field layui-field-title sys-list-field">
    <legend style="text-align:center;">修改密码</legend>
</fieldset>
<p class="login-box-msg" style="color: orangered" th:text="${mesgg}"></p>
<form class="layui-form layui-form-pane"  lay-filter="form" action="/user/updatepwd" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">新密码</label>
        <div class="layui-input-inline">
            <input type="text" name="newPassword" lay-verify="newPassword" placeholder="请输入新密码" value=""
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">密码确认</label>
        <div class="layui-input-inline">
            <input type="text" name="rePassword" lay-verify="rePassword" placeholder="请再次输入密码" value=""
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <button class="layui-btn" lay-submit lay-filter="add">立即提交</button>
    </div>

</form>
    </div>
    <!-- ./wrapper -->

    <!-- REQUIRED JS SCRIPTS -->

    <!-- jQuery 3 -->
    <script th:src="@{/adminLTE/bower_components/jquery/dist/jquery.min.js}"></script>
    <!-- Bootstrap 3.3.7 -->
    <script th:src="@{/adminLTE/bower_components/bootstrap/dist/js/bootstrap.min.js}"></script>

    <script th:src="@{/adminLTE/bower_components/fastclick/lib/fastclick.js}"></script>

    <!-- AdminLTE App -->
    <script th:src="@{/adminLTE/dist/js/adminlte.min.js}"></script>

    <script th:src="@{/adminLTE/dist/js/demo.js}"></script>

<script th:src="@{/layui/js/common.js}"></script>
<script th:src="@{/layui/js/layui.js}"></script>
<!-- layui规范化用法 -->
<script type="text/javascript">
    layui.config({
        base : "${ctx!}/js/"
    }).use(['form','layer','jquery', 'element'], function () {
        var $ = layui.jquery,
            form = layui.form,
            layer = layui.layer;
        //监听登陆提交
        form.verify({
            rePassword: function(value, item){ //value：表单的值、item：表单的DOM对象\
                var newPassword = $("input[name=newPassword]").val();
                if(newPassword !== value){
                    return '两次密码不一致';
                }
            }
        });
        form.on('submit(add)', function (data) {
            var id = $("#userId").val();
            return false;
        });
    });
</script>
</body>

</html>